<template>
  <div class="v-flow-config-section">
    <div class="config-section-title">谁可以提交</div>
    <ActionersConfig :actioners="actioners" @update:actioners="update">
      <template #btn-text>添加成员/角色</template>
    </ActionersConfig>
  </div>
</template>

<script setup lang="ts">
import type { Actioner } from '../../types'
const { getActioners, updateActioners } = inject<{
  getActioners: () => Actioner[]
  updateActioners: (data: Actioner[]) => void
}>('nodeConfig', {
  getActioners: () => {
    return []
  },
  updateActioners: () => {}
})
const actioners = ref<Actioner[]>([])
const update = (actioners: Actioner[]) => {
  updateActioners(actioners)
}
onMounted(() => {
  actioners.value = getActioners()
})
</script>
